package com.magicmovie.service;

import com.magicmovie.entity.Customer;
import com.magicmovie.utils.QueryFilters;
import com.magicmovie.utils.data.PageModel;
import org.springframework.web.bind.annotation.*;

import java.security.NoSuchAlgorithmException;
import java.util.Map;

@RestController
public interface CustomerService {
    @RequestMapping(value = "/customer/findByUsername",method = RequestMethod.GET)
    Customer findByUsername(@RequestParam("username")String username);

    @RequestMapping(value = "/customer/getByPrimaryKey",method = RequestMethod.GET)
    Customer getByPrimaryKey(@RequestParam("id")Integer id);

    @RequestMapping(value = "/customer/register",method = RequestMethod.GET)
    void register(@RequestParam("username") String username,@RequestParam("password") String password);

    @RequestMapping(value = "/customer/createToken",method = RequestMethod.POST)
    String createToken(@RequestBody Customer customer) throws NoSuchAlgorithmException;

    @RequestMapping(value = "/customer/findByToken",method = RequestMethod.GET)
    Customer findByToken(@RequestParam("token") String token);

    @RequestMapping(value = "/customer/logout",method = RequestMethod.POST)
    void logout(@RequestBody Customer customer) throws NoSuchAlgorithmException;

    @RequestMapping(value = "/customer/updateByPrimaryKeySelective",method = RequestMethod.POST)
    void updateByPrimaryKeySelective(@RequestBody Customer customer);

    @RequestMapping(value = "/customer/getByFilter",method = RequestMethod.POST)
    PageModel getByFilter(@RequestBody QueryFilters filters);

    @RequestMapping(value = "/customer/queryCount",method = RequestMethod.GET)
    Integer queryCount();
}
